package com.joker.orange.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.joker.common.annotation.ExcelDictFormat;
import com.joker.common.constant.CacheNames;
import com.joker.common.convert.ExcelDictConvert;
import com.joker.common.utils.file.FileUtils;
import com.joker.common.utils.redis.CacheUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;


/**
 * 启动页信息视图对象 t_startup_page
 *
 * @author Joker
 * @date 2024-06-09
 */
@Data
@ExcelIgnoreUnannotated
public class StartupPageVo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 唯一标识
     */
    @ExcelProperty(value = "唯一标识")
    private Long id;

    /**
     * 图片URL
     */
    @ExcelProperty(value = "图片URL")
    private String imageUrl;

    private String imageUrlCopy;

    /**
     * 超链接地址
     */
    @ExcelProperty(value = "超链接地址")
    private String hyperlinkAddress;

    /**
     * 图片显示时间
     */
    @ExcelProperty(value = "图片显示时间")
    private String displayTime;

    /**
     * 显示顺序
     */
    @ExcelProperty(value = "显示顺序")
    private Integer displayOrder;

    /**
     * 显示权重
     */
    @ExcelProperty(value = "显示权重")
    private Integer displayWeight;

    /**
     * 是否显示（0-显示、1-不显示）
     */
    @ExcelProperty(value = "是否显示", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=-显示、1-不显示")
    private String isDisplay;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    public String getImageUrlCopy() {
        return imageUrl;
    }

    public String getImageUrl() {
        return FileUtils.getUrl(imageUrl);
    }

}
